﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Doolin.MongoRepository.Commons
{
  public interface IRepository<TEntity> : IDisposable where TEntity : class,IMongoEntity
  {
    Task Add(TEntity obj);
    Task<TEntity> GetById(string id);
    Task<IEnumerable<TEntity>> GetAll();
    Task Update(TEntity obj);
    Task Remove(string id);
    Task<Tuple<IList<TEntity>, long>> PagingAsync(Expression<Func<TEntity, bool>> expression,int page, int size);
  }
}
